import java.util.List;


public class Profile extends AbstractProfileBand{
	private String email;
	private Instrument instrument;
	private Band band;
	private Login login;

	public Profile(String nick, String email, Instrument instrument, Style style) {
		super(nick, style);
		this.instrument = instrument;
		this.email = email;
	}
	
	public void createLogin(String user, String password){
		login = new Login(user, password);
	}

	public Band createBand(String nick, Style style, int year) {
		this.band = new Band(nick, style, year);
		return band;
	}
	
	public Topic createTopic(String title, String description){
		Topic topic = new Topic(this, title, description);
		return topic;
	}
	
	public void replayTopic(Topic topic, String message){
		Reply reply = new Reply(this, message);
		topic.replay(reply);
	}

	public void removeBand() {
		band = null;
	}
	
	public void removeFriend(Profile profile) {
		super.removeProfile(profile);
	}
	
	public void addFriend(Profile profile){
		super.addProfile(profile);
		profile.addProfile(this);
	}

	public void setInstrument(Instrument instrument) {
		this.instrument = instrument;
	}
	
	public List<Profile> getFriends(){
		return super.getProfiles();
	}

	public Instrument getInstrument() {
		return instrument;
	}

	public String getEmail() {
		return email;
	}

	public Band getBand() {
		return band;
	}
	
	public Login getLogin() {
		return login;
	}
	
	@Override
	public boolean match(Profile profile) {
		if (!super.match(profile))
			return false;
		if (!instrument.equals(profile.getInstrument()))
			return false;
		if (!email.equals(profile.getEmail()))
			return false;
		return true;
	}

}
